VimUnDo SXѷK&}i;~-36.2              7      /       /   /   /    g"7    _                                                                                                                                                                                                                                                                                                                                                                                          g                      To share an ollama instance, someone has to execute a client application that connects trough websocket to the server. There it will wait for http requests                                    5_                                                                                                                                                                                                                                                                                                                                                                                        g                    # SHARING OLLAMA INSTANCE5_                                                                                                                                                                                                                                                                                                                                                                                        g                     O3. verify that the project does as described above. This should be the server     
               
              1. rglob all files in                                  	To do a                                                 # USING 5_                                                                                                                                                                                                                                                                                                                                                                                        g        
      
      !1. rglob all files in the project5_                                                                                                                                                                                                                                                                                                                                                                                        g        
      
       1. glob all files in the project5_                                                                                                                                                                                                                                                                                                                                                                                         g        
      
       1. list all files in the project5_                       +                                                                                                                                                                                                                                                                                                                                                                 g       
      
      +1. list all files in the current directory.5_      	                                                                                                                                                                                                                                                                                                                                                                                   g                      -You are looking at a project called uberlama.5_      
           	                                                                                                                                                                                                                                                                                                                                                                        g                      [The idea is that using this project, users can share and use each other's ollama instances.5_   	              
                                                                                                                                                                                                                                                                                                                                                                        g                       5_   
                                                                                                                                                                                                                                                                                                                                                                                      g                      ## SHARING OLLAMA INSTANCE (SERVING)5_      
                                                                                                                                                                                                                                                                                                                                                                                   g                      To share an ollama instance, someone has to execute a client application that connects trough websocket to the server. There it will wait for http requests and send them to the ollama instance. 5_                 
                                                                                                                                                                                                                                                                                                                                                                        g                       5_   
                                                                                                                                                                                                                                                                                                                                                                                      g                       # USING OLLAMA INSTANCE (CLIENT)5_                                                                                                                                                                                                                                                                                                                                                                                         g                      To do a query, you have to execute a client application that connects to the server and sends the query to the ollama instance. It does it using the traditional ollama protocol.5_                                                                                                                                                                                                                                                                                                                                                                                         g                       5_                                                                                                                                                                                                                                                                                                                                                                                         g                      # Todo5_                                                                                                                                                                                                                                                                                                                                                                                         g                      41. list all files in the current directory using ls.5_                                                                                                                                                                                                                                                                                                                                                                                         g                      2. read all files5_                                                                                                                                                                                                                                                                                                                                                                                         g                      3. verify that the project does as described above. This should be the server application. The client applications are separte project.5_                                                                                                                                                                                                                                                                                                                                                                                         g                      'The app files will be named client.py                                                                   	Project                                    5_                                                                                                                                                                                                                                                                                                                                                                                        g              	      
Project fram          	                   Project language                             Project name: uberlama5_                    
   4                                                                                                                                                                                                                                                                                                                                                                 gM                     A websocket server that waits for clients to connect and puts them in a list. It will convert normal http requests from other applications to                    	              4The app files will be named client.py and server.py.5_                                                                                                                                                                                                                                                                                                                                                                                        g                    $Project uses: http,websocket,asyncio5_                                                                                                                                                                                                                                                                                                                                                                                        g                    "Project uses: http,aiohttp,asyncio5_                       *                                                                                                                                                                                                                                                                                                                                                                 g                    Project uses: aiohttp,asyncio                   *Project dependencies: as minimal possible.5_                    
                                                                                                                                                                                                                                                                                                                                                                     g        	             5_                    
                                                                                                                                                                                                                                                                                                                                                                     g"       
            The                  	                
          5_                                                                                                                                                                                                                                                                                                                                                                                         g!                     'This project will consist of two apps. 5_                                                                                                                                                                                                                                                                                                                                                                                         g!                     A client and server. 5_                                                                                                                                                                                                                                                                                                                                                                                          g!                     4The app files will be named client.py and server.py.5_      !                                                                                                                                                                                                                                                                                                                                                                                    g!                     HIt will be a bridge between a websocket server and a normal http server.5_       "           !                                                                                                                                                                                                                                                                                                                                                                        g!                     oThe client will connect to the server and send data to the server. The server will send the data to the client.5_   !   #           "                                                                                                                                                                                                                                                                                                                                                                        g!                      5_   "   $           #                                                                                                                                                                                                                                                                                                                                                                        g!                     # client.py description5_   #   %           $                                                                                                                                                                                                                                                                                                                                                                        g!                    A client that connects to the server with a websocket. When it receives data from the websocket it will connect with a normal socket to localhost:11434 and sends the data received from websocket. The response that the normal socket gives, has to be returned over the websocket. 5_   $   &           %                                                                                                                                                                                                                                                                                                                                                                        g!                      5_   %   '           &                                                                                                                                                                                                                                                                                                                                                                        g!                     # server.py5_   &   (           '                                                                                                                                                                                                                                                                                                                                                                        g!                     A websocket server that waits for clients to connect and puts them in a list. It will convert normal http requests from other applications to a websocket request. It will return the response to the client.5_   '   )           (                                                                                                                                                                                                                                                                                                                                                                        g!                     # PROMPT5_   (   *           )                                                                                                                                                                                                                                                                                                                                                                        g!                      5_   )   +           *                                                                                                                                                                                                                                                                                                                                                                       g!        
                                 	                  
                             2. stores websockets in                                  Project uses: aiohttp,asyncio5_   *   ,           +                                                                                                                                                                                                                                                                                                                                                                        g"&                     63. sends websocket messages to the application server.5_   +   -           ,                                                                                                                                                                                                                                                                                                                                                                        g"'                     ;4. receives websocket messages from the application server.5_   ,   .           -                                                                                                                                                                                                                                                                                                                                                                        g",        
   
          5_   -   /           .   
                                                                                                                                                                                                                                                                                                                                                                     g"2           
             # CLIENT               # CLIENT5_   .               /      7                                                                                                                                                                                                                                                                                                                                                                 g"6       
              72. receives http responses from the application server.5